
import Vue from 'vue'

export const validate = {
  email: /^([a-zA-Z0-9._-])+@([a-zA-Z0-9_-])+((.[a-zA-Z0-9_-]{2,3}){1,2})$/,
  mobile: /^1[0-9]{10}$/,
  phone: /^([0-9]{3,4}-)?[0-9]{7,8}$/,
  url: /^http[s]?:\/\/.*/,
  idCard: /^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}[\dXx]$/,
  mobilePhone: /^1(?:3\d|4[4-9]|5[0-35-9]|6[67]|7[013-8]|8\d|9\d)\d{8}$/
}

window.$validate = Vue.prototype.$validate = validate
